package List.ab;

import lombok.Data;
import org.junit.Test;

import java.util.LinkedList;
import java.util.List;

/**
 * @description:
 * @author: Mr.Z
 * @create: 2019-04-01 14:29
 */
public class test {

    @Test
    public void test() {
        B b = new B();
        b.setC("123");
        b.setD("456");
        System.out.println(b);  //  B{a='a', b='b'}

        A a = new A();
        List<B> bList = new LinkedList<>();
        bList.add(b);
        System.out.println(bList); //  [B{a='a', b='b'}]
        a.setBList(bList);
        System.out.println(a.getBList());//  [B{a='a', b='b'}]
    }
}

@Data
class A {
    private List<B> bList;
}

@Data
class B {
    private String c;
    private String d;
}
